import { Redirect } from 'umi';
import { IRouteComponentProps } from 'umi';

export default (props: IRouteComponentProps) => {
  const auth = JSON.parse(localStorage.getItem('auth') || '[]');
  if (auth.includes(6)) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/login" />;
  }
};
